package com.myapp.struts.menu;

import java.util.ArrayList;

public class USEveningXML {

    private static USEveningXML usEveningXMLObj;
    ArrayList<FoodItems> usEveningXMLArray = new ArrayList<FoodItems>();

    public static synchronized USEveningXML getSingletonObject() {
        if (usEveningXMLObj == null) {
            usEveningXMLObj = new USEveningXML();
        }
        return usEveningXMLObj;
    }

    public Object clone() throws CloneNotSupportedException {
        throw new CloneNotSupportedException();
    }

    public String getUSEveningXML(String fileLoc) {
        String fileName = "";
        MenuRead menuReadObj = new MenuRead();
        usEveningXMLArray = menuReadObj.ReadMenu(Constants.US);
        
        MenuGenerate menuGenerateObj = new MenuGenerate();
        usEveningXMLArray = menuGenerateObj.GenerateMenu(usEveningXMLArray, "Evening Only");

        MenuFormat menuFormatObj = new MenuFormat();
        fileName = menuFormatObj.FormatMenu(usEveningXMLArray, Constants.XML, fileLoc);
        return fileName;
    }
}
